<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>一片綠葉后台管理</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta http-equiv="Access-Control-Allow-Origin" content="*">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="icon" href="favicon.ico">
	<link rel="stylesheet" href="layui/css/layui.css" media="all" />
	<link rel="stylesheet" href="css/font_eolqem241z66flxr.css" media="all" />
	<link rel="stylesheet" href="css/main.css" media="all" />
	<script type="text/javascript" src="layui/layui.js"></script>
	<script type="text/javascript" src="js/nav.js"></script>
	<script type="text/javascript" src="js/leftNav.js"></script>
	<script type="text/javascript" src="js/index.js"></script>
</head>
<body class="main_body">
	<div class="layui-layout layui-layout-admin">
		<!-- 顶部 -->
		<div class="layui-header header">
			<div class="layui-main">
				<a href="#" class="logo">一片綠葉后台管理</a>
				<!-- <!-- 搜索 -->
				<div class="layui-form component">
			        <select name="modules" lay-verify="required" lay-search="">
						<option value="">直接选择或搜索选择</option>
						<option value="1">layer</option>
						<option value="2">form</option>
						<option value="3">layim</option>
						<option value="4">element</option>
						<option value="5">laytpl</option>
						<option value="6">upload</option>
						<option value="7">laydate</option>
						<option value="8">laypage</option>
						<option value="9">flow</option>
						<option value="10">util</option>
						<option value="11">code</option>
						<option value="12">tree</option>
						<option value="13">layedit</option>
						<option value="14">nav</option>
						<option value="15">tab</option>
						<option value="16">table</option>
						<option value="17">select</option>
						<option value="18">checkbox</option>
						<option value="19">switch</option>
						<option value="20">radio</option>
			        </select>
			        <i class="layui-icon">&#xe615;</i>
			    </div> -->
			   
			    <ul class="layui-nav top_menu">
			    	<li class="layui-nav-item " >
						<a href="http://localhost:8080/DogHome/DogHomeServlet?md=testObj"><i class="iconfont icon-gonggao"></i><cite>首页</cite></a>
					</li>
			 
					<!-- <li class="layui-nav-item lockcms" pc>
						<a href="javascript:;"><i class="iconfont icon-lock1"></i><cite>锁屏</cite></a>
					</li> -->
					<li class="layui-nav-item" pc>
						<a href="javascript:;">
							<img src="static/images/liu.jpg" id="img" class="layui-circle" width="35" height="35">
							<cite id="nametop">你好</cite>
						</a>
						<dl class="layui-nav-child">
							<dd><a href="javascript:;" data-url="page/user/userInfo.html"><i class="iconfont icon-zhanghu" data-icon="icon-zhanghu"></i><cite>个人资料</cite></a></dd>
							<dd><a href="javascript:;" data-url="page/user/changePwd.html"><i class="iconfont icon-shezhi1" data-icon="icon-shezhi1"></i><cite>修改密码</cite></a></dd>
							<dd><a href="javascript:;" id="quit"><i class="iconfont icon-loginout"></i><cite>退出</cite></a></dd>
						</dl>
					</li>
				</ul>
			</div>
		</div>
		<!-- 左侧导航 -->
		<div class="layui-side layui-bg-black">
			<div class="user-photo">
				<a class="img" title="我的头像" ><img src="static/images/liu.jpg" id="imgleft"></a>
				<p>你好！<span class="userName" id="nameleft">刘康甫</span></p>
			</div>
			<div class="navBar layui-side-scroll"></div>
		</div>
	
		<!-- 右侧内容 -->
		<div class="layui-body layui-form">
			<div class="layui-tab marg0" lay-filter="bodyTab">
				<ul class="layui-tab-title top_tab">
					<li class="layui-this" lay-id=""><i class="iconfont icon-computer"></i> <cite>后台首页</cite></li>
				</ul>
				<div class="layui-tab-content clildFrame">
					<div class="layui-tab-item layui-show">
						<iframe src="page/main.html"></iframe>
					</div>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript" src="../admin/js/jquery-3.4.1.js"></script>
	
	<!-- 移动导航 -->
	<div class="site-tree-mobile layui-hide"><i class="layui-icon">&#xe602;</i></div>
	<div class="site-mobile-shade"></div>
<script type="text/javascript">
layui.config({
	base : "js/"
}).use(['form','element','layer','jquery'],function(){
	var form = layui.form,
		layer = parent.layer === undefined ? layui.layer : parent.layer,
		element = layui.element,
		$ = layui.jquery;
	$(function(){
		$.post(
				'http://localhost:8080/DogHome/login?md=toLogin',
				function(res){
					if (res.msg=="true") {
						
						$("#nametop").text(res.data[0].username)
						$("#nameleft").text(res.data[0].username)
						$("#img").attr("src",
								"static/images/" +res.data[0].userimg);
						$("#imgleft").attr("src",
								"static/images/" +res.data[0].userimg);
					}else{
						layer.msg('信息错误，请先登录！！！', {
							  icon: 2,
							  time: 2000 
							}, function(){
								location.href='login.html';
							}); 
						
					}
				},"json"
		);
		$("#quit").click(function(e){
			layer.confirm('确定退出', {icon: 3, title:'提示'}, function(index){
				$.post('http://localhost:8080/DogHome/login?md=loginOut',{},function(res){
					if(res.success){
						location.href='login.html';
					}else{
						layer.msg('信息错误！！！', {
							  icon: 2,
							  time: 2500 
							})
					}
				},"json");
				layer.close(index);
				});
		})
	})
})
	</script>
</body>
</html>